package com.heima.admin.config;

import com.heima.admin.filter.AdminTokenInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author:Dikk
 * @create: 2023-07-31 21:38
 * @Description: WebConfig
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private AdminTokenInterceptor adminTokenInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(adminTokenInterceptor).addPathPatterns("/**")
                .excludePathPatterns("/login");
    }
}
